/*
 * Copyright [2022] [https://www.xiaonuo.vip]
 *
 * Snowy采用APACHE LICENSE 2.0开源协议，您在使用过程中，需要注意以下几点：
 *
 * 1.请不要删除和修改根目录下的LICENSE文件。
 * 2.请不要删除和修改Snowy源码头部的版权声明。
 * 3.本项目代码可免费商业使用，商业使用请保留源码和相关描述文件的项目出处，作者声明等。
 * 4.分发源码时候，请注明软件出处 https://www.xiaonuo.vip
 * 5.不可二次分发开源参与同类竞品，如有想法可联系团队xiaonuobase@qq.com商议合作。
 * 6.若您的项目无法满足以上几点，需要更多功能代码，获取Snowy商业授权许可，请在官网购买授权，地址为 https://www.xiaonuo.vip
 */
package vip.xiaonuo.biz.modular.cabinetpermission.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import vip.xiaonuo.biz.modular.cabinetpermission.entity.BizCabinetPermission;
import vip.xiaonuo.biz.modular.cabinetpermission.param.*;
import vip.xiaonuo.biz.modular.cabinetpermission.vo.BizCabinetDoorPermissionResp;
import vip.xiaonuo.biz.modular.cabinetpermission.vo.BizCabinetPermissionResp;
import vip.xiaonuo.biz.modular.cabinetpermission.vo.ClientAdminCabinetPermission;
import vip.xiaonuo.biz.modular.cabinetpermission.vo.ClientUserCabinetPermission;
import vip.xiaonuo.biz.modular.certification.result.CertificationVO;

import java.util.List;

/**
 * 柜门权限Service接口
 *
 * @author kongxm
 * @date 2022/11/20 17:04
 **/
public interface BizCabinetPermissionService extends IService<BizCabinetPermission> {

    /**
     * 获取柜门权限分页
     *
     * @author kongxm
     * @date 2022/11/20 17:04
     */
    Page<BizCabinetPermissionResp> page(BizCabinetPermissionPageParam bizCabinetPermissionPageParam);

    /**
     * 添加柜门权限
     *
     * @author kongxm
     * @date 2022/11/20 17:04
     */
    void add(BizCabinetPermissionAddParam bizCabinetPermissionAddParam);

    /**
     * 编辑柜门权限
     *
     * @author kongxm
     * @date 2022/11/20 17:04
     */
    void edit(BizCabinetPermissionEditParam bizCabinetPermissionEditParam);

    /**
     * 删除柜门权限
     *
     * @author kongxm
     * @date 2022/11/20 17:04
     */
    void delete(List<BizCabinetPermissionIdParam> bizCabinetPermissionIdParamList);

    /**
     * 获取柜门权限详情
     *
     * @author kongxm
     * @date 2022/11/20 17:04
     */
    BizCabinetPermission detail(BizCabinetPermissionIdParam bizCabinetPermissionIdParam);

    /**
     * 获取柜门权限详情
     *
     * @author kongxm
     * @date 2022/11/20 17:04
     **/
    BizCabinetPermission queryEntity(String id);

    void authorize(BizCabinetPermissionAuthorizeParam param);

    void batchAuthorizeUsers(BizCabinetPermissionAuthorizeBatchUsersParam param);

    void refuse(BizCabinetPermissionRefuseParam param);

    void freeze(BizCabinetPermissionFreezeParam param);

    void batchFreezeUsers(BizCabinetPermissionFreezeBatchUsersParam param);

    void unfreeze(BizCabinetPermissionUnfreezeParam param);

    void batchAuthorize(BizCabinetPermissionAuthorizeBatchParam param);

    void batchRefuse(BizCabinetPermissionRefuseBatchParam paramList);

    /**
     * 查询当前用户是否有柜门权限
     *
     * @param isSeparatedPermission
     * @param cabinetDoorId
     * @param cabinetId
     * @param cabinetGroupId
     * @return
     */
    boolean hasDoorPermWithCurrentUser(boolean isSeparatedPermission, String cabinetDoorId, String cabinetId, String cabinetGroupId, String userId);

    BizCabinetDoorPermissionResp listPermission(BizCabinetPermissionListParam param);

    Page<ClientUserCabinetPermission> listForClientUser(ClientCabinetPermissionPageParam param);

    boolean applyPermForClientUser(ClientCabinetPermissionApplyParam param);

    Page<ClientAdminCabinetPermission> pagePermissionForAdmin(ClientAdminCabinetPermissionPageParam param);

    boolean grantPermForClientAdmin(BizCabinetPermissionAuthorizeParam param);

    List<CertificationVO> listCertification(String userId);
}
